getApp();

var t = require("../../utils/data.js");

Page({
    data: {
        cnum: null,
        nid: null,
        infotype: null
    },
    onLoad: function(n) {
        this.setData({
            cnum: n.cnum,
            nid: n.nid,
            infotype: n.infotype
        });
        a = this;
        console.log(this.data.artype);
        var a = this;
        wx.request({
            url: t.getInterfaceData() + "minfor.action",
            data: {
                cnum: this.data.cnum,
                nid: this.data.nid
            },
            header: {
                "content-type": "application/json"
            },
            success: function(t) {
                a.setData({
                    stulist: t.data,
                    list: "",
                    myTitle: "授课信息"
                }), console.log(t.data);
            }
        });
    },
    changmention: function(n) {
        var a = this, e = n.currentTarget.dataset.aid, i = n.currentTarget.dataset.stunum;
        wx.request({
            url: t.getInterfaceData() + "changmention.action",
            data: {
                cid: this.data.cnum,
                stunum: i,
                s: e,
                times: this.data.nid
            },
            header: {
                "content-type": "application/json"
            },
            success: function(n) {
                console.log(n.data), wx.showToast({
                    icon: "success",
                    title: "修改成功"
                }), wx.request({
                    url: t.getInterfaceData() + "minfor.action",
                    data: {
                        cnum: a.data.cnum,
                        nid: a.data.nid
                    },
                    header: {
                        "content-type": "application/json"
                    },
                    success: function(t) {
                        a.setData({
                            stulist: t.data,
                            list: "",
                            myTitle: "授课信息"
                        }), console.log(t.data);
                    }
                });
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});